package com.anhndt.smslater;

import android.os.Bundle;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.anhndt.autosms.R;
import com.anhndt.smslater.fragmentManager.MainViewAdapter;
import com.viewpagerindicator.TitlePageIndicator;

public class ActivitySMSLater extends SherlockFragmentActivity {

	// Declare variable
	private ViewPager mPager;
	private TitlePageIndicator mIndicator;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_sms_later);

		initScreen();
	}

	private void initScreen() {
		FragmentPagerAdapter adapter = new MainViewAdapter(
				getApplicationContext(), getSupportFragmentManager());

		mPager = (ViewPager) findViewById(R.id.pager);
		mPager.setAdapter(adapter);
		
		mIndicator = (TitlePageIndicator) findViewById(R.id.indicator);
		mIndicator.setViewPager(mPager);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getSupportMenuInflater().inflate(R.menu.activity_sms_later, menu);
		return super.onCreateOptionsMenu(menu);
	}

}
